﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace MyAnim.Models
{
    public partial class FileInfo
    {
        public override string ToString()
        {
            return this.Name;
        }

        public String GetHttpLocation()
        {
          
            Models.Server serv = this.Server.Select(s =>
            {
                if (s.Enabled == 1)
                    return s;
                else
                    return null;
                ;
            }).ToArray()[0];

            String HttpAddress = "http://";
            HttpAddress = serv.Address;
            HttpAddress += "/";
            HttpAddress += this.Name;
           return HttpAddress;
        }
    }
}